﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using CetWin.Phone.Entity;
using Phone.Framework.Threads;

namespace CetWin.Phone.Services
{
    public interface IDataService
    {
        void Update();
    }

    public class BaseDataService : IDataService
    {
        protected CetWinDbDataContext db;


        //private static ThreadManager tm= ThreadManager.CreateInstance();
        public BaseDataService()
        {
            db = CetWinDbDataContext.GetDataContext();
        }

        private static Object thisLock = new Object();
        public void Update()
        {
            lock (thisLock)
            {
                db.SubmitChanges();
            }
        }
    }
}
